﻿//  Copyright (c) 2011 Ray Liang (http://www.dotnetage.com)
//  Licensed MIT: http://www.opensource.org/licenses/mit-license.php

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DNA.Mvc.Publishing.Data.Entity
{
    public class TranslatedCopyRepository : GenericPubEntityRepository<TranslatedCopy>, ITranslatedCopyRepository
    {
        public TranslatedCopyRepository() : base() { }

        public TranslatedCopyRepository(PubDB db) : base(db) { }

        public TranslatedCopy Find(int articleID, string lang)
        {
            return DbSet.FirstOrDefault(a => a.ArticleID == articleID && a.Language.Equals(lang, StringComparison.OrdinalIgnoreCase));
        }
    }
}
